<?php

use common\helpers\Html;
use common\helpers\Url;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Level Orders';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= Html::encode($this->title) ?></h3>
                <div class="box-tools">
                    <?= Html::create(['edit']) ?>
                </div>
            </div>
            <div class="box-body table-responsive">
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'tableOptions' => ['class' => 'table table-hover'],
        'columns' => [
            [
                'class' => 'yii\grid\SerialColumn',
                'visible' => false,
            ],
            //'id',
            [
                'label' => '关联用户',
                'attribute' => 'member_id',
                'filter' => Html::activeTextInput(
                    $searchModel,
                    'member_id',
                    [
                        'class' => 'form-control',
                        'placeholder' => '用户ID'
                    ]
                ),
                'value' => function ($model) {
                    return "用户ID：" . $model->member->id . '<br>' .
                        "昵称：" . $model->member->nickname . '<br>' .
                        "账号：" . $model->member->username . '<br>' ;
                        // "手机：" . $model->member->mobile . '<br>';
                },
                'format' => 'raw',
            ],
            'before_level',
            'amount',
            'created_at:datetime',
            'after_level',
            //'status',
    ]
    ]); ?>
            </div>
        </div>
    </div>
</div>
